<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="/common/common.jsp"%>
<%@ page import="com.chanyachting.emall.util.*" %>
<%@ page import="java.util.*" %>

<%@ page import="com.chanyachting.emall.domain.*" %>
<%@ page import="com.chanyachting.emall.dao.*" %>
<%@ page import="com.chanyachting.emall.util.RequestUtil" %>
<%@ page import="com.chanyachting.emall.service.*" %>
<%@ page import="com.chanyachting.emall.serviceImpl.*" %>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="" /> 
<meta name="description" content="" />
<link href="css/import.css" type="text/css" rel="stylesheet" />
<title></title>

<script type="text/javascript" src="<%=root %>/js/jquery-1.3.2.min.js" charset="utf-8">//ADCRM</script>
<script type="text/javascript" src="<%=root %>/js/jquery.form.js" charset="utf-8">//ADCRM</script>

<script language="javascript" type="text/javascript">

	$(function(){

		$.ajaxSetup ({
		    cache: false //关闭AJAX相应的缓存
		});

		});


	//创建普通类型商品
	function saveproduct(theForm){

		//alert(theForm.action);

		options={
			    url:theForm.action,
			    success: function(data){
					
					alert("创建成功！");
				    }
			  };
				
		$(theForm).ajaxSubmit(options);
	}

</script>
<%

	//从session中获得公司对象
	RequestUtil ru=new RequestUtil(request);
	
	Company company=(Company)ru.getSessionObject(CompanyService.COMPANY_IN_SESSION,new Company());
	
	String id = ru.getParameter("id","0").trim();
	
	String actionName = "";
	String actionType = "";
	
	if ("0".equals(id)) {
		actionName = "/memberBackend/sellyachtCreate.do";
		id = "";
		actionType = "发布";
	} else {
		actionName = "/memberBackend/sellyachtUpdate.do";
		actionType = "修改";
	}
%>
</head>

<body>
<div class="tab_box">
	<div class="tab_menu">
    	<a href="product_sellyacht_create.jsp" class="current"><%=actionType %>游艇销售</a>
    </div>
	<div class="tab_submenu">
	  <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="50%"><div class="mu_title"><a href="product_sellyacht_create.jsp">基本信息</a> <a href="in3_1_b.html">图文信息</a></div></td>
          <td align="right"><strong><a href="#">预览</a><a href="#">打印</a><a href="#">导出</a></strong></td>
        </tr>
      </table>
	</div>
</div>

<form action="<%=root %><%=actionName %>" method="post" enctype="multipart/form-data" name="form3" id="form3">

<input type="hidden" name="companyId" value="<%= company.getId() %>" />
<input type="hidden" name="point" value="0" />
<input type="hidden" name="type" value="01" />
<input type="hidden" name="status" value="00" />
<input type="hidden" name="id" value="<%=id %>" />

<div id="bigbox">
  <table width="700" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
      <td width="50%"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td width="100" height="28" align="right">产品名称：</td>
          <td><label>
            <input type="text" name="name" id="textfield48" value="${sellyachtForm.sellyacht.name}" />
          </label></td>
        </tr>
        <tr>
          <td height="28" align="right">市场售价：</td>
          <td><label>
            <input type="text" name="productPrice" id="textfield47" value="${sellyachtForm.sellyacht.productPrice}" />
          </label></td>
        </tr>
        
      </table></td>
      <td valign="bottom"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
              <td height="28" align="right">&nbsp;</td>
              <td><img src="images/pp_03.gif" width="128" height="86" /></td>
            </tr>
            <tr>
              <td width="100" height="28" align="right">显示图片：</td>
              <td><label>
                <input type="file" name=imgUrl id="fileField" value="${sellyachtForm.sellyacht.imgUrl}" />
              </label></td>
            </tr>
        </table></td>
    </tr>
    <tr>
      <td valign="bottom">&nbsp;</td>
      <td valign="bottom">&nbsp;</td>
    </tr>
  </table>
  <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
      <td colspan="3" align="left" class="td_top">&nbsp;</td>
      </tr>
    <tr>
      <td width="100" height="28" align="left"><div class="ptitle">主要特点</div></td>
      <td width="230" align="right">长度：</td>
      <td width="370"><label>
        <input name="length" type="text" id="textfield" size="30" value="${sellyachtForm.sellyacht.length}" />
      </label></td>
    </tr>
    <tr>
      <td height="28" colspan="2" align="right">宽度：</td>
      <td><label>
        <input type="text" name="width" id="textfield4" value="${sellyachtForm.sellyacht.width}" />
      </label></td>
    </tr>
    <tr>
      <td height="28" colspan="2" align="right">吃水：</td>
      <td><label>
        <input type="text" name="depth" id="textfield9" value="${sellyachtForm.sellyacht.depth}" />
      </label></td>
    </tr>
    <tr>
      <td height="28" colspan="2" align="right">船体构造：</td>
      <td><label>
        <input type="text" name="structure" id="textfield10" value="${sellyachtForm.sellyacht.structure}" />
      </label></td>
    </tr>
    <tr>
      <td height="28" colspan="2" align="right">引擎：</td>
      <td><input type="text" name="" id="textfield19" value="${sellyachtForm.sellyacht.engine}" /></td>
    </tr>
    <tr>
      <td height="28" colspan="2" align="right">引擎已使用（年）：</td>
      <td><select name="engineAge">
      	<%
      		for(int i=0;i<100;i++){
      			
      	%>
      	<option value="<%=i %>"><%=i %></option>
      	<%		
      		}
      	%>
      	
      </select>
        (二手游艇多少时间)</td>
    </tr>
    <tr>
      <td height="28" colspan="2" align="right">巡航速度：</td>
      <td><input type="text" name="speed" id="textfield31" value="${sellyachtForm.sellyacht.speed}" /></td>
    </tr>
    <tr>
      <td height="28" colspan="2" align="right">最高速度：</td>
      <td><input type="text" name="speedMax" id="textfield32" value="${sellyachtForm.sellyacht.speedMax}" /></td>
    </tr>
    <tr>
      <td height="28" colspan="2" align="right">巡航范围：</td>
      <td><input type="text" name="driveDistance" id="textfield35" value="${sellyachtForm.sellyacht.driveDistance}" /></td>
    </tr>
    <tr>
      <td height="28" colspan="2" align="right">燃料能力/消耗：</td>
      <td><input type="text" name="consume" id="textfield36" value="${sellyachtForm.sellyacht.consume}" /></td>
    </tr>
    <tr>
      <td colspan="2" align="right">&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td colspan="3" align="left" class="td_top">&nbsp;</td>
      </tr>
    <tr>
      <td height="28" align="left"><div class="ptitle">建设</div></td>
      <td height="28" align="right">建造年份：</td>
      <td><label>
        <select name="buildYear" id="select5">
        	<%
        		for(int i=2009;i>1930;i--){
        			
        	%>
        	<option value="<%=i %>"><%=i %></option>
        	<%		
        		}
        	%>
        </select>
      </label></td>
    </tr>
    <tr>
      <td height="28" colspan="2" align="right">制造商或品牌：</td>
      <td><label>
        <select name="brandId" id="select3">
        	<option value="0">请选择</option>
        </select>
        <input type="text" name="brandSummary" id="textfield37" value="${sellyachtForm.sellyacht.brandSummary}" />
      </label></td>
    </tr>
    <tr>
      <td height="28" colspan="2" align="right">船体设计师：</td>
      <td><label>
        <input type="text" name="bodyDesign" id="textfield38" value="${sellyachtForm.sellyacht.bodyDesign}" />
      </label></td>
    </tr>
    <tr>
      <td height="28" colspan="2" align="right">室内设计师：</td>
      <td><label>
        <input type="text" name="roomDesign" id="textfield39" value="${sellyachtForm.sellyacht.roomDesign}" />
      </label></td>
    </tr>
    <tr>
      <td height="28" colspan="2" align="right">船籍：</td>
      <td><input type="text" name="state" id="textfield40" value="${sellyachtForm.sellyacht.state}" /></td>
    </tr>
    
    <!-- 
    <tr>
      <td height="28" colspan="2" align="right">分类：</td>
      <td><input type="text" name="textfield" id="textfield41" /></td>
    </tr>
     -->
    
    
    <tr>
      <td height="28" colspan="2" align="right">产地：</td>
      <td><label>
        <select name="location" id="select6">
       		<option value="0">请选择</option>
        </select>
        <input type="text" name="locationSummary" id="textfield3" value="${sellyachtForm.sellyacht.locationSummary}" />
      </label></td>
    </tr>
    <tr>
      <td height="28" colspan="2" align="right">游艇类型：</td>
      <td><label>
        <select name="productCategoryId" id="select7">
         <option value="0">请选择</option>
        	<%
        		Iterator yatype=CodeMap.yachtType.keySet().iterator();
        	
        		while(yatype.hasNext()){
        			
        			String key=yatype.next().toString();
        			
        			String value=CodeMap.yachtType.get(key).toString();
        	%>
        	
        	<option value="<%= key %>"><%=value %></option>
        		
        	<%		
        		}
        	
        	%>
        	
        </select>
      </label></td>
    </tr>
    <tr>
      <td height="28" colspan="2" align="right">城市：</td>
      <td><select name="city" id="select4">
      	<option value="0">请选择</option>
      </select></td>
    </tr>
    <tr>
      <td height="28" colspan="2" align="right">交艇时间：</td>
      <td><label>
        <select name="payTime" id="select8">
        	<option value="0">请选择</option>
        </select>
      </label></td>
    </tr>
    <tr>
      <td colspan="2" align="right">&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td colspan="3" class="td_top">&nbsp;</td>
      </tr>
    <tr>
      <td height="28" align="left"><div class="ptitle">住宿</div></td>
      <td height="28" align="right">客舱：</td>
      <td><label>
        <input type="text" name="roomNumber" id="textfield42" value="${sellyachtForm.sellyacht.roomNumber}" />
      </label></td>
    </tr>
    <tr>
      <td height="28" colspan="2" align="right">客人：</td>
      <td><label>
        <input type="text" name="maxPersonNumber" id="textfield43" value="${sellyachtForm.sellyacht.maxPersonNumber}" />
      </label></td>
    </tr>
    <tr>
      <td height="28" colspan="2" align="right">全体人员：</td>
      <td><label>
        <input type="text" name="allPersonNumber" id="textfield44" value="${sellyachtForm.sellyacht.allPersonNumber}" />
      </label></td>
    </tr>
    <tr>
      <td height="28" colspan="2" align="right">洗手间/淋浴：</td>
      <td><label>
        <input type="text" name="alWCNumber" id="textfield45" value="${sellyachtForm.sellyacht.alWCNumber}" />
      </label></td>
    </tr>
    <tr>
      <td colspan="2" align="right">&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td colspan="3" class="td_top">&nbsp;</td>
      </tr>
    <tr>
      <td height="28" align="left"><div class="ptitle">载客</div></td>
      <td height="28" align="right">理想人数：</td>
      <td><label>
        <input type="text" name="embarkNumber" id="textfield46" value="${sellyachtForm.sellyacht.embarkNumber}" />
      </label></td>
    </tr>
    <tr>
      <td height="28" colspan="2" align="right">最多载客：</td>
      <td><label>
        <input type="text" name="maxEmbarkNumber" id="textfield49" value="${sellyachtForm.sellyacht.maxEmbarkNumber}" />
      </label></td>
    </tr>
    <tr>
      <td colspan="2" align="right">&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td colspan="3" class="td_top">&nbsp;</td>
      </tr>
    <tr>
      <td height="28" align="left"><div class="ptitle">船上设备</div></td>
      <td height="28" align="right">基本配备：</td>
      <td><label>
      <select name="equipment" id="select">
      	<option value="0">请选择</option>
      </select>
      </label></td>
    </tr>
    <tr>
      <td colspan="2" align="right">&nbsp;</td>
      <td><textarea name="equipmentSummary" id="textarea" cols="45" rows="5">${sellyachtForm.sellyacht.equipmentSummary}</textarea></td>
    </tr>
    <tr>
      <td colspan="2" align="right" class="td_bottom">&nbsp;</td>
      <td class="td_bottom">&nbsp;</td>
    </tr>
    <!--<tr>
      <td colspan="3" class="td_top">&nbsp;</td>
    </tr>
    <tr>
      <td height="28" align="right"><strong>发布视频　</strong></td>
      <td height="28" align="right">产品标题：</td>
      <td><p>
          <label></label>
          <label>
          <input type="text" name="textfield2" id="textfield3" />
          </label>
      </p></td>
    </tr>
    <tr>
      <td colspan="2" align="right">产品/服务描述：</td>
      <td height="28"><label>
        <textarea name="textarea8" id="textarea9" cols="45" rows="5"></textarea>
      </label></td>
    </tr>-->
  </table>
  <table width="700" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td align="right">&nbsp;</td>
      <td width="550">&nbsp;</td>
    </tr>
    <tr>
      <td width="150" align="right">选择发布频道：</td>
      <td><select name="channelId" id="select9">
      	<option value="0">请选择</option>
      	<%
      		ChannelDAO cDao = new ChannelDAO();
      		Channel parentC = cDao.getChannelByType("02");  //游艇销售
      		if (parentC != null) {
      			List<Channel> subChannel = cDao.getSubChannel(parentC);
      			for (Channel tmpC:subChannel) {
      				%>
      				<option value="<%=tmpC.getId() %>"><%=tmpC.getName() %></option>
      				<%
      			}
      		}
      	%>
      </select>
        <input type="radio" name="radio" id="radio" value="radio" />
立即发布
<input type="radio" name="radio" id="radio2" value="radio2" />
待上架 　 <span class="txt_gray">什么是待上架? 说明：待上架的内容不在前台显示</span></td>
    </tr>
  </table>
  <table width="700" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
      <td align="center" class="td_bottom">&nbsp;</td>
    </tr>
    <tr>
      <td height="60" align="center"><label>
      <input type="button" name="button3" id="button3" value="预览" />
      <input type="button" name="button3" id="button4" value="保存" onclick="saveproduct(this.form);"/>
      <input type="reset" name="button3" id="button6" value="取消" />
</label></td>
    </tr>
  </table>
</div>
</form>
</body>
</html>

